#pragma once

#include "sys/IInterface.h"
#include "ChangeID.h"

interface ISubject;
interface IObserver;
class InterestedObjects;

interface IChangeManager : public IInterface
{
	DEFINE_IID(IID_ChangeManager);

	virtual void EnableAllObserver(bool enable=true) = 0;
	virtual bool IsAllObserverEnabled() const = 0;
	virtual void EnableObservers(viid subjectIID, viid interestedObjectIID,bool enable=true) = 0;
	virtual bool IsObserversEnabled(viid subjectIID, viid interestedObjectIID) const = 0;

	virtual bool IsObserverRegistered(viid subjectIID, viid interestedObjectIID,IObserver* observer) const = 0;
	virtual void RegisterObserver(viid subjectIID, viid interestedObjectIID,IObserver* observer) = 0;
	virtual void UnRegisterObserver(viid subjectIID, viid interestedObjectIID,IObserver* observer) = 0;

	virtual void ChangeNotify(viid subjectIID, IObject* subject,const InterestedObjects& interestedObjects,uint32 data=NULL) = 0;
	virtual void ChangeNotify(viid subjectIID, viid interestedObjectIID,IObject* subject,const InterestedObjects& interestedObjects,uint32 data=NULL) = 0;
};